/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cabs.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author HaoPT
 */
@Entity
@Table(name = "advertise", catalog = "DB_Radio_Cabs", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Advertise.findAll", query = "SELECT a FROM Advertise a"),
    @NamedQuery(name = "Advertise.findById", query = "SELECT a FROM Advertise a WHERE a.id = :id"),
    @NamedQuery(name = "Advertise.findByPaymentId", query = "SELECT a FROM Advertise a WHERE a.paymentId = :paymentId"),
    @NamedQuery(name = "Advertise.findByCompanyName", query = "SELECT a FROM Advertise a WHERE a.companyName = :companyName"),
    @NamedQuery(name = "Advertise.findByDesignation", query = "SELECT a FROM Advertise a WHERE a.designation = :designation"),
    @NamedQuery(name = "Advertise.findByAddress", query = "SELECT a FROM Advertise a WHERE a.address = :address"),
    @NamedQuery(name = "Advertise.findByMobile", query = "SELECT a FROM Advertise a WHERE a.mobile = :mobile"),
    @NamedQuery(name = "Advertise.findByTelephone", query = "SELECT a FROM Advertise a WHERE a.telephone = :telephone"),
    @NamedQuery(name = "Advertise.findByFaxNumber", query = "SELECT a FROM Advertise a WHERE a.faxNumber = :faxNumber"),
    @NamedQuery(name = "Advertise.findByEmail", query = "SELECT a FROM Advertise a WHERE a.email = :email"),
    @NamedQuery(name = "Advertise.findByDatepay", query = "SELECT a FROM Advertise a WHERE a.datepay = :datepay"),
    @NamedQuery(name = "Advertise.findByExpdate", query = "SELECT a FROM Advertise a WHERE a.expdate = :expdate"),
    @NamedQuery(name = "Advertise.findByStatus", query = "SELECT a FROM Advertise a WHERE a.status = :status")})
public class Advertise implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "payment_id", nullable = false)
    private int paymentId;
    @Basic(optional = false)
    @Column(name = "company_name", nullable = false, length = 50)
    private String companyName;
    @Column(name = "designation", length = 50)
    private String designation;
    @Basic(optional = false)
    @Column(name = "address", nullable = false, length = 100)
    private String address;
    @Column(name = "mobile", length = 50)
    private String mobile;
    @Basic(optional = false)
    @Column(name = "telephone", nullable = false, length = 50)
    private String telephone;
    @Column(name = "fax_number", length = 50)
    private String faxNumber;
    @Column(name = "email", length = 50)
    private String email;
    @Lob
    @Column(name = "description", length = 2147483647)
    private String description;
    @Basic(optional = false)
    @Column(name = "datepay", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date datepay;
    @Basic(optional = false)
    @Column(name = "expdate", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date expdate;
    @Basic(optional = false)
    @Column(name = "status", nullable = false)
    private boolean status;

    public Advertise() {
    }

    public Advertise(Integer id) {
        this.id = id;
    }

    public Advertise(Integer id, int paymentId, String companyName, String address, String telephone, Date datepay, Date expdate, boolean status) {
        this.id = id;
        this.paymentId = paymentId;
        this.companyName = companyName;
        this.address = address;
        this.telephone = telephone;
        this.datepay = datepay;
        this.expdate = expdate;
        this.status = status;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(int paymentId) {
        this.paymentId = paymentId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getFaxNumber() {
        return faxNumber;
    }

    public void setFaxNumber(String faxNumber) {
        this.faxNumber = faxNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getDatepay() {
        return datepay;
    }

    public void setDatepay(Date datepay) {
        this.datepay = datepay;
    }

    public Date getExpdate() {
        return expdate;
    }

    public void setExpdate(Date expdate) {
        this.expdate = expdate;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Advertise)) {
            return false;
        }
        Advertise other = (Advertise) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cabs.entity.Advertise[id=" + id + "]";
    }

}
